package com.example.mapper;

import com.example.entity.*;
import com.example.result.CommonResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @project: smart-property
 * @description: 住户管理 mapper 层
 * @author: cjq
 * @create: 2022-11-21 13:54
 **/
@Mapper
public interface HouseholdMapper {
    /**
     * 查询楼座
     * @param cid
     * @return
     */
    List<BuildingModel> listBuilding(Integer cid);

    /**
     * 查询单元
     * @return
     */
    List<UnitModel> listUnit();

    /**
     * 查询房屋
     * @return
     */
    List<HouseModel> listFloor();

    /**
     * 住户编号查重
     * @param hNumber
     * @param villageId
     * @return
     */
    Household listHnumber(@Param("hNumber") String hNumber,@Param("villageId") Integer villageId);

    /**
     * 添加住户信息
     * @param household
     * @return
     */
    int addHouseHold(Household household);

    /**
     * 修改住户信息
     * @param household
     * @return
     */
    int updateHouseHold(Household household);

    /**
     * 住户列表展示
     * @param householdType
     * @param house
     * @param start
     * @param type
     * @param input
     * @param startTime
     * @param endTime
     * @param villageId
     * @return
     */
    List<Household> queryHouseHold(@Param("householdType") String householdType,@Param("start") Integer start,@Param("type") String type,@Param("input") String input,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("house") String house,@Param("villageId") Integer villageId);

    /**
     * 住户审核
     * @param id
     * @param examineMessage
     * @param start
     * @return
     */
    int examineStart(@Param("id") Integer id,@Param("examineMessage") String examineMessage,@Param("start") Integer start);

    /**
     * 删除住户信息
     * @param id
     * @return
     */
    int delHouseHold(@Param("id") Integer id);

    /**
     * 批量删除住户信息
     * @param ids
     * @return
     */
    int batchDel(@Param("id") Integer[] ids);

    /**
     * 住户统计
     * @param villageId
     * @return
     */
    Count countHouseHoid(@Param("villageId") Integer villageId);
}
